/**
 * Created by Administrator on 2015/12/29.
 */
angular.module('maincontent.service',[])
  .service('mainContentService',['$http','appItfAopService',function($http,appItfAopService){

    //var loginData={"username":"","userpwd":""};
    var params={
      "orderQueryParams":{
        "orderId":"",//订单编码，可选
        "orderType":"",//订单类型，固定传值01：开户，必选;
        "orderSource":"03",//订单来源，01：沃易登；02：移动助销；，必选；以后会固定写03，暂时为了测试数据写01
        "orderStatus":"",//订单状态，可选
        "custName":"",//开户客户姓名，可选
        "serialNumber":"",//开户号码，可选
        "createBeginTime":"",//订单创建开始时间
        "createEndTime":"",//订单创建结束时间
        "departTag":""//是否查部门下多有订单标记，可选
      },
      "orderCount":"0", //当月业务量
      "orderFee":"0",//当月收费
      "AgentFee":"0"//账户余额
    }
    return {
      getParams:function() {
        return params;
      },
      //调用订单查询的接口来获得：当前业务量：当月收费
      get_BasicOrderInfo:function()
      {
        return appItfAopService.do_getOrderSumInfo_req()
      },
      //查询代理商子账户
      get_qtySysAcct:function(params)
      {
        return appItfAopService.do_qtySysAcct_rep(params);
      },
      //获得当月的第一天
      get_MonthFristDay:function()
      {
        var myDate = new Date();
        var year = myDate.getFullYear();
        var month = myDate.getMonth()+1;
        if (month<10){
          month = "0"+month;
        }
        var firstDay = year+"-"+month+"-01 00:00:00";
        return firstDay;
      },
      //获取当月的最后一天
      get_MotnthLastDay:function()
      {
        var myDate = new Date();
        var year = myDate.getFullYear();
        var month = myDate.getMonth()+1;
        if (month<10){
          month = "0"+month;
        }
        myDate=new Date(year,month,0);
        var lastDay=year+"-"+month+"-"+myDate.getDate()+" 23:59:59";
        return lastDay;
      },
      //插入日志
      insertLog:function(param)
      {
        return appItfAopService.do_insertLog_req(param);
      }
    }

  }]);
